<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>商品收藏-{$webseting.web_title}</title>
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1">
<meta name="format-detection" content="telephone=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<script src="__PUBLIC__/wap/js/flexible.js"></script>
<link href="__PUBLIC__/wap/css/icons.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/wap/css/base.css" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/wap/css/cart.css" />
	<link href="__PUBLIC__/wap/css/product.css"  rel="stylesheet">
</head>
<body class="favorites">
<div class="head">
	<a href="{:U('wap/member/index')}" class="md-close back"><i class="iconfont">&#xe617</i>	</a>
	<h2 >收藏 (<span class="num coll_num">{$count.goods}</span>)</h2>
</div>
<div class="cartlist">
		<ul class=" more_html">
			<volist name="list" id="vo" >
				<li class="goods goods_{$vo.rec_id}">
					<a class="" href="{:U('wap/Goods/goods_detail',array('id'=>$vo['goods_id']))}">
						<div class="goodsimg">
							<div class="img bgcover " style=" background: url('{$vo.goods_img}')">
							</div>
						</div>
					</a>
						<div class="info">
							<div class="title">
								{$vo.goods_name}
							</div>
							<div class="titlesub">
								{$vo.goods_brief}
							</div>
							<div class="wastebin-container del_good del_good_{$vo.rec_id}" data="{$vo.rec_id}" >
								<div class="wastebin">
									<i class="wastebin-up"></i>
									<i class="wastebin-down"></i>
								</div>
							</div>
							<div class="pay">
								<div class="pirce">
									<span class="num orange">￥{$vo.shop_price} </span> <span class="subpirce num gray textline">¥{$vo.market_price}</span>
								</div>
							</div>
						</div>
						<div class="clearfix">
						</div>

				</li>
			</volist>
		</ul>
</div>
<div class="">
	<div class="loading get_more">
		<if condition="$count['goods'] gt 10 && count($list) eq 10">
			加载更多
			<else/>
			无更多数据
		</if>
	</div>
</div>
<include file="Public/footer_new" />
<!--end 页脚-->
<input type="hidden" name="p" value="2" />

<script type="text/javascript" src="__PUBLIC__/wap/js/jquery.min.js"></script>

<script type="text/javascript">
	$(function(){
		var num=$(".coll_num").html();
		$(".get_more").click(function(){
			get_more();
		});
		$(".del_good").click(function(){
			var _this_del=$(this);
			var rec_id=_this_del.attr('data');
			$.ajax({
				url: "{:U('wap/collect/del_collect')}",
				type:'get',
				data: {rec_id:rec_id},
				dataType: 'json',
				success: function(data){
					if(data.status==1){
						num--;
						$('.coll_num').html(num);
						$('.goods_'+rec_id).hide();
s
					}else{
						//alert(data.error)
						layer.msg(data.error, {icon: 5});
					}
				}
			});

		});
	});

    var load_more=0;
    var load_none=0;
    $(function() {
        //滚动加载
        $(window).scroll(function () {
            var scrollTop = $(this).scrollTop();
            var scrollHeight = $(document).height();
            var windowHeight = $(this).height();
            if (scrollTop + windowHeight == scrollHeight) {
                //此处是滚动条到底部时候触发的事件，在这里写要加载的数据，或者是拉动滚动条的操作
                if (load_none != 1) {
                    if (load_more == 1) {
                        $('.get_more').html('加载中......');
                    } else {
                        get_more();
                    }
                }
            }
        });
        $(window).load(function () {
            get_more();
        });
    })

	function get_more(){
		var p=$("input[name='p']").val();
		$.ajax({
			url: "{:U('wap/collect/index')}",
			type:'post',
			data: {p:p},
			dataType: 'json',
			success: function(data){
				//console.log(data);
				var con=1;
				if(data){
					var option='';
					$.each(data, function(i, value) {
						//this指向当前元素
						//i表示Array当前下标
						//value表示Array当前元素
						option=option+'<li class="goods">'
						+'<a class="" href="<?php echo U('wap/Goods/goods_detail'); ?>?id='+value.goods_id+'">'
						+'<div class="goodsimg">'
						+'<div class="img bgcover " style=" background: url('+value.goods_img+')">'
						+'</div>'
						+'</div>'
						+'</a>'
						+'<div class="info">'
						+'<div class="title">'
						+value.goods_name
						+'</div>'
						+'<div class="titlesub">	'
						+value.goods_brief
						+'</div>'
						+'<div class="pay">'
						+'<div class="pirce">'
						+'<span class="num orange">￥'+value.shop_price+' </span> <span class="subpirce num gray textline">¥'+value.market_price+'</span>'
						+'</div>'
						+'</div>'
						+'</div>'
						+'<div class="clearfix">'
						+'</div>'
						+'</li>';
						con++;
					});
					$('.more_html').append(option);
					$("input[name='p']").val(parseInt(p)+1);
				}
				if(con<10){
					$('.get_more').html('无更多数据');
					$('.get_more').fadeOut(3000);
				}
			}
		});
	}


</script>
</body>
</html>